﻿using FluentValidation;
using Mes.Application.DTO.Inputs.MasterData;

namespace Mes.Application.Web.Validators.MaterialClassValidators
{
    public class UpdateMaterialClassInputValidator : AbstractValidator<UpdateMaterialClassInput>
    {
        public UpdateMaterialClassInputValidator()
        {
            RuleFor(x => x.TypeId).GreaterThan(0).WithMessage("物料类类型Id必须大于0");
            RuleFor(x => x.TypeName).NotEmpty().WithMessage("物料类类型名称不能为空")
                               .Length(1, 50).WithMessage("物料类类型名称长度必须在1到50之间");

        }
    }
}
